/*
 * TravelSpeed.java
 * Team qq 2011
 */
package main.java.backend.com.teamqq.timetrail;

public enum TravelSpeed {
	STOPPED("Stopped"), LUDICROUS("Ludicrous"), WARP("Warp"), MACH("Mach");

	/**
	 * The value for the stopped enum
	 */
	private static final int STOPPED_VALUE = 0;

	/**
	 * The value for the ludicrous enum
	 */
	private static final int LUDICROUS_VALUE = 15;

	/**
	 * The value for the warp enum
	 */
	private static final int WARP_VALUE = 10;

	/**
	 * The value for the mach enum
	 */
	private static final int MACH_VALUE = 5;

	/** The speed you travel at per turn */
	private final int perTurnDistance;

	/** The name of the pace */
	private final String name;

	/**
	 * Sets up an enumerated travel speed
	 * 
	 * @param name
	 *            The name of the travel speed
	 */
	private TravelSpeed(String name) {
		this.name = name;

		if (this.name.equals("Stopped")) {
			this.perTurnDistance = STOPPED_VALUE;
		} else if (this.name.equals("Ludicrous")) {
			this.perTurnDistance = LUDICROUS_VALUE;
		} else if (this.name.equals("Warp")) {
			this.perTurnDistance = WARP_VALUE;
		} else if (this.name.equals("Mach")) {
			this.perTurnDistance = MACH_VALUE;
		} else {
			this.perTurnDistance = 0;
		}
	}

	/**
	 * Gets the perTurnDistance of the pace
	 * 
	 * @return The amount of time units traveled per turn
	 */
	public int getPerTurnDistance() {
		return perTurnDistance;
	}

	/**
	 * Gets the name of the pace
	 * 
	 * @return what the pace is called
	 */
	public String getName() {
		return name;
	}
}
